package com.technique.api.dao.mapper;

import com.technique.api.dao.entity.RequirementTome;
import com.technique.api.dao.entity.RequirementTomeExample;
import com.technique.api.dao.entity.RequirementTomeKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface RequirementTomeMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @SelectProvider(type=RequirementTomeSqlProvider.class, method="countByExample")
    int countByExample(RequirementTomeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @DeleteProvider(type=RequirementTomeSqlProvider.class, method="deleteByExample")
    int deleteByExample(RequirementTomeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @Delete({
        "delete from requirement_tome",
        "where id = #{id,jdbcType=BIGINT}",
          "and to_uid = #{toUid,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(RequirementTomeKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @Insert({
        "insert into requirement_tome (id, to_uid, ",
        "create_date, state)",
        "values (#{id,jdbcType=BIGINT}, #{toUid,jdbcType=BIGINT}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{state,jdbcType=SMALLINT})"
    })
    int insert(RequirementTome record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @InsertProvider(type=RequirementTomeSqlProvider.class, method="insertSelective")
    int insertSelective(RequirementTome record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @SelectProvider(type=RequirementTomeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="to_uid", property="toUid", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.SMALLINT)
    })
    List<RequirementTome> selectByExample(RequirementTomeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "id, to_uid, create_date, state",
        "from requirement_tome",
        "where id = #{id,jdbcType=BIGINT}",
          "and to_uid = #{toUid,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="to_uid", property="toUid", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.SMALLINT)
    })
    RequirementTome selectByPrimaryKey(RequirementTomeKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @UpdateProvider(type=RequirementTomeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") RequirementTome record, @Param("example") RequirementTomeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @UpdateProvider(type=RequirementTomeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") RequirementTome record, @Param("example") RequirementTomeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @UpdateProvider(type=RequirementTomeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(RequirementTome record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table requirement_tome
     *
     * @mbggenerated
     */
    @Update({
        "update requirement_tome",
        "set create_date = #{createDate,jdbcType=TIMESTAMP},",
          "state = #{state,jdbcType=SMALLINT}",
        "where id = #{id,jdbcType=BIGINT}",
          "and to_uid = #{toUid,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(RequirementTome record);
}